<?php
class ShortcutController
{
	function svreasonAction()
	{
		$objShortCut = new Shortcut();
		$objShortCut -> increamentViewShortCut('shortcut_3', '+1');
		echo '<img src="'. APPLICATION_URL .'public/images/7 reasons.jpg" width="800" />';
	}
	function seminarAction()
	{
		$objSmarty = DRX::load("smarty");
		$objShortCut = new Shortcut();
		$objShortCut -> increamentViewShortCut('shortcut_2', '+1');
		$objSmarty -> display("shortcut/seven_reason.tpl");
	}
	function quizresultAction()
	{
		$objSmarty = DRX::load('smarty');
		$arrPostQuiz = $_POST["quiz"];
		$strResults = '';
		
		
		//echo $strResults = $objSmarty -> fetch("shortcut/quiz_results.tpl");return;
		
		if ( count($arrPostQuiz) < 10 )
		{
			$strResults = 0;
		}
		else
		{
			$intPoint = 0;
			foreach ( $arrPostQuiz as $intKey => $arrValue ) 
			{
				if ( $intKey == 1 || $intKey == 2 || $intKey == 3 || $intKey == 4 || $intKey == 6 || $intKey == 9 )
					$intPoint += $arrValue[0];
				if ( $intKey == 5 || $intKey == 8 )
				{
					$intPoint += (6-$arrValue[0]);
				}
			}	
			
			if ( $intPoint < 15 )
				$strMsgResults = "Well, we regret to say you may find another suitable program... this MBA is not for you now! Maybe after some more years of professional experience? All the best in your career anyway!";
			else if ( $intPoint >= 15 && $intPoint <= 20 )
				$strMsgResults = "Hum... you seem to be too young... or too old? Contact us to find out if you are a suitable candidate for our MBA program!";
			else if ( $intPoint > 21 && $intPoint <= 40 )
				$strMsgResults = "Well, it seems you could be a great student at Solvay Brussels School! Have a look at the new curriculum of our MBA program and send us your application!";
			
			$strResults = '<div style="margin:70px 20px 10px; font-size:15px;">'.$strMsgResults.'</div>';
			$strResults .= '<div style="margin:20px; font-size:15px;">Part time MBA Program&nbsp;<a target="_blank" href="http://www.solvay-mba.edu.vn/programme/page/132">Click here</a></div>';
			$strResults .= '<div style="margin:50px 20px 10px; text-align:center;"><img width="300" src="'. APPLICATION_URL .'public/images/mba_sortcut1.jpg"  /></div>';
				
		}
		echo "<script type='text/javascript'>parent.endQuiz('$strResults');</script>";
	}
	function quizAction()
	{
		$objSmarty = DRX::load('smarty');
		$objShortCut = new Shortcut();
		$objShortCut -> increamentViewShortCut('shortcut_1', '+1');
		$objSmarty -> display("shortcut/quiz.tpl");
	}
}
?>